import React from "react";
import { connect } from "react-redux";
import { Link } from "react-router-dom";

const Welcome = props => {
  const { isLogin } = props;

  return (
    <div className="welcome">
      <h1 className="title">数据可视化</h1>
      <div className="content">
        <p className="content-title">可视化内容</p>
        <ul className="content-list">
          <li>个人帐单</li>
          <li>微博热搜</li>
          <li>网易云音乐热搜</li>
          <li>豆瓣热映评分</li>
          <li>国家数据-国内生产总值</li>
          <li>国家数据-居民消费水平</li>
          <li>国家数据-三次产业构成</li>
          <li>国家数据-出生死亡率</li>
          <li>国家数据-能量消费量</li>
          <li>等...</li>
        </ul>
      </div>
      {isLogin ? (
        <Link className="btn-enter" to="/main">
          点击进入
        </Link>
      ) : (
        <Link className="btn-enter" to="/login">
          点击登录
        </Link>
      )}
    </div>
  );
};

export default connect(store => ({
  isLogin: store.home.isLogin
}))(Welcome);
